package com.eclink.asset.hardware.controller;

import com.eclink.asset.hardware.service.RfidService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags="RFID管理接口")
@RestController
@RequestMapping("/rfid")
public class RFIDController {

    @Resource
    RfidService rfidService;

    @ApiOperation("盘点")
    @PutMapping("/inventory/{uuid}")
    public ResponseEntity<Integer> inventory(@PathVariable String uuid) {
        rfidService.inventory(uuid);
        return ResponseEntity.ok(1);
    }

    @ApiOperation("停止盘点")
    @PutMapping("/stopInventory/{uuid}")
    public ResponseEntity<Integer> stopInventory(@PathVariable String uuid) {
        rfidService.stopInventory(uuid);
        return ResponseEntity.ok(1);
    }

}
